
//
//  QKSingleton.m
//  testTool
//
//  Created by Su on 2019/5/3.
//  Copyright © 2019 com.qiankun. All rights reserved.
//

#import "QKSingleton.h"

@interface QKSingleton()<NSCopying>

@end

@implementation QKSingleton
static QKSingleton *_singleton;



/**
 返回一个单例对象

 @return 单例对象
 */
+(instancetype)shareSingleton{
    
        static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _singleton = [[self alloc] init];
    });
    return _singleton;
}


+(instancetype)allocWithZone:(struct _NSZone *)zone{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _singleton = [super allocWithZone:zone];
    });
    return _singleton;
}


-(id)copyWithZone:(NSZone *)zone{
    return _singleton;
}
@end
